import React, { Component } from 'react';
import {
    View,
    Text,
    TouchableOpacity,
} from 'react-native';
import { homefourStyle as styles } from '../../../../styles';
import sal from '../../../util/sal';
import fmt from '../../../util/fmtDateUtil';
var Dimensions = require('Dimensions');
var width = Dimensions.get('window').width;
var height = Dimensions.get('window').height;
export default class Homefour_1 extends Component {
    // 初始化模拟数据
    constructor(props) {
        super(props);
    }
    //list子项加载方法
    render() {
        if (this.props.postion != undefined) {
            return (
                <TouchableOpacity
                    style={styles.foureveryall}
                    onPress={() => { this.goGet('Postionin', this.props.postion.postionId); }}
                    activeOpacity={1}>
                    <View style={styles.fourblue}><Text style={styles.fourbluein}></Text></View>
                    <Text style={styles.fourname}>{this.props.postion.postionName}</Text>
                    <Text style={styles.fourmoney}>{sal(this.props.postion.postionMm, this.props.postion.postionYm)}</Text>
                    <Text style={styles.fourarea}>{this.props.postion.postionSpace}</Text>
                    <Text style={styles.fourtime}>{fmt(this.props.postion.postionTime, 'HH:mm')}</Text>
                </TouchableOpacity>
            )
        } else {
            return null;
        }

    }
    goGet(name, id) {
        this.props.navigation.navigate(name, { useId: id });
    }
}